import React from 'react';
import { Select } from 'antd';

interface SerialFlowControlViewProps {
  value?: string;
  onChange?: (value: string) => void;
}

const options = [
  { value: 'none', label: '无' },
  { value: 'rtscts', label: 'RTS/CTS' },
  { value: 'xonxoff', label: 'XON/XOFF' },
];

const SerialFlowControlView: React.FC<SerialFlowControlViewProps> = ({
  value,
  onChange,
}) => (
  <Select
    placeholder="请选择流控"
    value={value}
    onChange={onChange}
    style={{ width: '100%' }}
    allowClear
    options={options}
  />
);

export default SerialFlowControlView;
